package com.task.scheduling.processor;

import com.task.scheduling.processor.contract_processor.FileProcessor;
import com.task.scheduling.processor.contract_processor.UpdateTairCacheProcessor;

public enum ProcessorTypes {

	//MAIL_PROCESSOR(1, MailProcessor.class, "发邮件"),
	UPDATE_TAIR(1, UpdateTairCacheProcessor.class, "updateTairCacheProcessor"),
	INIT_SYSTEM_PROCESSOR(3, FileProcessor.class, "FileProcessor");

	private int type;
	private Class<? extends Processor> processor;
	private String desc;

	ProcessorTypes(int type, Class<? extends Processor> processor, String desc) {
		this.type = type;
		this.processor = processor;
		this.desc = desc;
	}


	public int getType() {
		return type;
	}


	public Class<? extends Processor> getProcessor() {
		return processor;
	}



	public static final ProcessorTypes get(int type) {
		for (ProcessorTypes processorType : ProcessorTypes.values()) {
			if (processorType.getType() == type) {
				return processorType;
			}
		}
		return null;
	}


	public String getDesc() {
		return desc;
	}


	public void setDesc(String desc) {
		this.desc = desc;
	}
}
